from flask import current_app
from playhouse.shortcuts import model_to_dict

from apps.controller.news import send_news
from apps.models.order import Order
from apps.models.user import User


def order_status(data):
    """
    确定报价
    """
    order = Order.get_or_none(Order.id == data['id'])
    order.status = 'waiting_implemented'
    order.save()
    data = order.get_standard_obj()
    data['type'] = 'order'
    data['code'] = 'quotation@order'
    send_news(data)
    del data['code']

def quotation_status(data):
    print(data)
